# !/usr/bin/env python
# coding=utf-8
# @Time    : 2018/8/14 14:37
# @Author  : 6imensiva
# @Site    : https://gitee.com/dimensiva/rpc_dao.git
# @File    : car_types_service.py
# @Software: PyCharm
# @Version: 2.7.5
from db import car_types_dao
from idl_output.ttypes import CarTypesDB
from py3_utils import my_thrift


def get_car_types(brandCode):
	orm_data = car_types_dao.get_car_types(brandCode)
	if not orm_data:
		return None

	thrift_data = CarTypesDB()
	my_thrift.obj_copy_with_same_name(orm_data, thrift_data)
	return thrift_data